<?php
	 include 'FusionCharts.php';
	 function getColor(){
	 	for($i=0;$i<6;$i++){
	 		$color = dechex(rand(0,15));
	 		$ret .= $color;
	 	}
	 	return $ret;
	 }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/tip.css" />
<script src="js/xheditor/jquery/jquery-1.4.4.min.js"></script>
<title>问卷管理__问卷题目预览</title>
<style>
.input_text {
	border: 0;
	border-bottom: 1px solid black;
	background: #ffffff;
	width: 200px;
	height: 20px;
}
</style>
</head>
<body>
<div id="wrap">
<div class="m_search qq_bh"><span class="red"><b><?php echo $quesnr['TITLE'];?></b></span>
&nbsp;</div>
<form action='' method='post' id='form'>
<div class="m_revise" id="revise">
<div class="field">
<div class="itemText"><span><?php echo $quesnr['NOTE']?></span></div>
</div>
        
        <?php 
        	if(is_array($qids) && count($qids)>0){
        		$i=1;
        		foreach ($qids as $v){
        ?>
        	<div class="field">
				<h2 class="itemTitle">
					<?php echo $i++.'、'.$allAquest[$v]['TITLE'].'('.$optarr[$allAquest[$v]['QTYPE']].')';?>
				</h2>
<?php
	if($allAquest[$v]['QTYPE']<3){ //选择题图形显示
		//Create an XML data document in a string variable
		$strXML  = "
			<graph caption='' xAxisName='Option' yAxisName='次数' decimalPrecision='0' formatNumberScale='0' chartRightMargin='30'>";
		$flag = 0;
		$j = 1;
		$output = '<br><font color="#999999">其它的回答:</font>';
		foreach ($allOpt as $val){
			if($val['QID'] == $v){
				$flag ++;
				$strXML .= "<set name='".$val['ONAME']."' value='".$selan[$val['OID']]."' color='".getColor()."'/>";
				if(is_array($other[$val['OID']]) && count($other[$val['OID']])>0){
					foreach ($other[$val['OID']] as $v){
						$output .= '<br>&nbsp;&nbsp;'.$j++.'、&nbsp;'.$v['OPTVAL'];
					}	
				}
			}
			
		}
		$strXML .= "</graph>";
		echo renderChartHTML("/images/FCF_Bar2D.swf", "", $strXML, "myNext", 500, $flag*40);
		echo $output;
	}else{
		$j = 1;
		foreach ($optval[$v] as $value){
			$input = $value['OPTVAL']?$value['OPTVAL']:'<font color="green">未填写</font>';
			echo '&nbsp;&nbsp;&nbsp;<font color="#999999">'.$j++.'、</font>'.$input.'<Br>';
		}
	}
?>
			</div>
        <?php
									}
								}
								?>
            <div class="field"
	style="border-bottom: 0px dashed #BCBCBC;">
<div class="itemText"><a href="###"> <input class="btn_gray" name=""
	type="button" onclick="window.close();" value="关 闭" /> </a></div>
</div>

</form>
</div>
</div>
</body>
</html>
